<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePayFlowTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_flow', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("uid")->default(0)->comment("用户ID");
            $table->integer("order_id")->default(0)->comment("订单id");
            $table->string("order_sn",30)->default('')->comment("订单号");
            $table->tinyInteger("order_type",1)->default(0)->comment('订单类型 1油卡 2话费 3商城');
            $table->integer("amount")->default(0)->comment("支付金额（分）");
            $table->string("type",20)->default('')->comment("支付方式");
            $table->tinyInteger("is_pay",1)->default(0)->comment("是否支付 0否 1是");
            $table->dateTime("pay_time")->default('')->comment('支付时间');
            $table->string("pay_sn",100)->default('')->comment('支付平台单号');
            $table->text("extra")->default('')->comment('额外信息（一般存支付返回信息）');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pay_flow');
    }
}
